import numpy as np

A = np.array([[56.0, 0.0, 4.4, 68.0],
            [1.2, 104.0, 52.0, 8.0],
            [1.8, 135.0, 99.0, 0.9]])

print(A)

#计算每一列的和=================================
cal = A.sum(axis=0)
print(cal)

#计算每行数据占每列的百分比======================
percentage = 100*A/cal.reshape(1,4)#可以不加.reshape(1.4),在不确定矩阵大小时，确定其为1×4的矩阵
print(percentage)